package com.home.base.core.framework.enums;

/**
 * Description: 统一返回类型枚举
 * Created by 王大宸 on 2020-12-25 16:30
 * Created with IntelliJ IDEA.
 */
public enum ResultCodeEnum {

    // 操作成功与失败
    SUCCESS(true, 200, "操作成功！"),
    ERROR(false, 500500, "操作失败！"),

    // 请求参数校验
    PARAMS_VALID(false, 400100, "参数校验错误！"),
    PARAMS_VALID_MSG(false, 400200, "参数校验错误！"),

    // 未知异常
    EXCEPTION(false, 500, "系统异常,请联系管理员！"),

    // 用户登录异常
    CLIENT_TOKEN_EXCEPTION(false, 400300, "登录异常,请重新登录！"),
    NO_LOGIN_USER_INFO(false, 400400, "用户不存在！"),
    LOCKED_ACCOUNT(false, 400500, "账号已被冻结！"),
    USER_PASSWORD_NOT_MATCH(false, 400600, "登录密码错误，请检查密码时候正确！"),

    PAGE_SUCCESS(true, 200, "操作成功！"),
    PAGE_ERROR(false, 400100, "操作失败！"),
    PAGE_EXCEPTION(false, 500100, "系统异常,请联系管理员！"),
    ;

    // 响应是否成功
    private final Boolean success;
    // 响应状态码
    private final Integer status;
    // 响应信息
    private final String message;

    ResultCodeEnum(Boolean success, Integer status, String message) {
        this.success = success;
        this.status = status;
        this.message = message;
    }

    public Boolean getSuccess() {
        return success;
    }

    public Integer getStatus() {
        return status;
    }

    public String getMessage() {
        return message;
    }

}
